package com.zr.gdms.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.zr.gdms.model.Score;
import com.zr.gdms.service.ScoreSelectStuService;
import com.zr.gdms.serviceimpl.ScoreSelectStuServiceimpl;

import net.sf.json.JSONObject;

public class ScoreSelectStuController extends HttpServlet {
			ScoreSelectStuService sv=new ScoreSelectStuServiceimpl();	
	/**
	 * 单个学生成绩查询
	 * */
	@Override
				protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
					// TODO Auto-generated method stub
		        doPost(req, resp);
				}
				@Override
				protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
				// TODO Auto-generated method stub
					req.setCharacterEncoding("utf8");
					resp.setCharacterEncoding("utf8");
					HttpSession session=req.getSession();
					PrintWriter pt=resp.getWriter();
					int score3=Integer.parseInt(req.getParameter("score3"));
					int page=Integer.parseInt(req.getParameter("page"));
					int rows=Integer.parseInt(req.getParameter("rows"));
					Score sc=new Score();
					JSONObject jj=sv.getScoreStudent(sc.getSid(), score3, page, rows);
					pt.write(jj.toString());
					pt.flush();
					pt.close();		
				}
}
